<?php

/**
 * @author Martin Pernica
 * @copyright 2008
 */

 echo '<br /><h2><a href="index.php?p=components&name=user">Zpět</a></h2><br />';
 if(!empty($_POST['name'])){
    $query = $GLOBALS['db']->query("UPDATE ".$GLOBALS['db_prefix']."users_groups SET name = '".$_POST['name']."', description = '".$_POST['description']."' WHERE id = '".intval($_GET['id'])."'") or die($GLOBALS['db']->error());
	echo '<h2>'.USER_GROUP_EDITED.' !</h2>';
 }
$data = $GLOBALS['db']->query("SELECT * FROM ".$GLOBALS['db_prefix']."users_groups WHERE id = '".intval($_GET['id'])."' LIMIT 1");
$data = $data->fetch_array();
?>
<form action="<?php echo $_SERVER['PHP_SELF'] .'?'. $_SERVER['QUERY_STRING'] ?>" method="POST">
<table>
<tr><td><?php echo USER_GROUP_NAME; ?> :</td><td><input type="text" name="name" size="30" value="<?php echo $data['name'] ?>"/></td></tr>
<tr><td><?php echo USER_GROUP_DESCRIPTION; ?>  :</td><td><input type="text" name="description" size="30" value="<?php echo $data['description'] ?>"/></td></tr>
<tr><td><input type="submit" value="<?php echo SUBMIT ?>" /></td><td></td></tr>
</table>
</form>